package com.thz.friend.controller.question;

import com.thz.common.core.controller.BaseController;
import com.thz.common.core.pojo.TableDataInfo;
import com.thz.common.core.result.Result;
import com.thz.friend.pojo.question.dto.QuestionQueryDTO;
import com.thz.friend.pojo.question.vo.QuestionDetailVO;
import com.thz.friend.pojo.question.vo.QuestionVO;
import com.thz.friend.question.IQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description
 * @Author thz
 * @Date 2025/3/29
 */
@RestController
@RequestMapping("/question")
public class QuestionController extends BaseController {


    @Autowired
    private IQuestionService questionService;

    @GetMapping("/semiLogin/list")
    public TableDataInfo list(QuestionQueryDTO questionQueryDTO) {
        return questionService.list(questionQueryDTO);
    }


    @GetMapping("/semiLogin/hotList")
    public Result<List<QuestionVO>> hotList() {
        return Result.ok(questionService.hotList());
    }

    @GetMapping("/detail")
    public Result<QuestionDetailVO> detail(Long questionId) {
        return Result.ok(questionService.detail(questionId));
    }

    @GetMapping("/preQuestion")
    public Result<String> preQuestion(Long questionId) {
        return Result.ok(questionService.preQuestion(questionId));
    }

    @GetMapping("/nextQuestion")
    public Result<String> nextQuestion(Long questionId) {
        return Result.ok(questionService.nextQuestion(questionId));
    }

}
